<template>
  <div class="container">
    <!-- 表单 -->
    <el-form ref="form" :model="type" label-width="80px">
      <el-form-item label="分类名称">
        <el-input v-model="type.typeName" />
      </el-form-item>

      <el-form-item>
        <el-button type="primary" @click="onSubmit">立即添加</el-button>
        <el-button>取消</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>
<script>
// 引入接口API
import userApi from '@/api/admin'
export default {
  data() {
    return {
      type: {}
    }
  },
  methods: {
    onSubmit() {
      userApi.save(this.user).then(Response => {
        this.$message.success(Response.msg)
        this.$emit('closeAddDialog')
        this.$emit('getUserList')
      })
    }
  }
}
</script>
<style scoped>
.container{
  margin: 20px 35px;
}
</style>
